/*****************************************************************
**                                                             	**
**  Copyright (C) 2004 Amlogic,Inc.                            	**
**  All rights reserved                                        	**
**        Filename : logo.c /Project:AVOS		       **
**        Revision : 1.0                                       	**
**                                                             	**
*****************************************************************/
#include "../menu.h"
#include "logoEvent.h"
#include "./win/NetmenuSetupEvent.h"

INT32S WinLogoMsgProc_720P(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return LogoOnShow(hwnd, lpParam) ;
		case WM_HIDEWINDOW:
			return LogoOnHide(hwnd, lpParam);
			
		default:
			return 0 ;
    }
    return 0 ;
}

void SetWinLogoPalette_720P(void)
{
    YUVENTRY mask_para[4] = {0,79,4095,4095};
    AWSetAlphaMask(0,4, mask_para);
	YUVENTRY palette_para[16] = {0x8000 | 16392,0x8000 | 21176,0x8000 | 17752,0x8000 | 16392,17592,19496,19832,19656,19992,18104,17673,17817,15864,15721,15912,9849};
    AWSetPalette(0,16, palette_para);
    return ;
}

void SetWinLogoPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    switch(CurOsdSize){
		case OsdSize720p:
            RECT Draw720WindowRect = {0,0,1280,720};
            pControl->winrect = Draw720WindowRect;
            CREATEWINDOWPARAM Draw720WindowPara = {1,{{0,0,1280,720},    {0,0,0,0},{0,0,0,0},{0,0,0,0}},{PF_PALETTE_256,0,0,0},    SetWinLogoPalette_720P};
            AWSendMessage(pControl, WM_WINDOW_RESET_DRAW_AREA, (INT32S)&Draw720WindowPara);
            break ;

    }//end of switch
    return;
}

HWND *CreateControlWinLogo_720P(HWND* pParent,INT8U CurOsdSize)
{
    HWND* pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            CREATEWINDOWPARAM Normalwindow_para = {1,{{0,0,1280,720},{0,0,0,0},{0,0,0,0},{0,0,0,0}},{PF_PALETTE_256,0,0,0},SetWinLogoPalette_720P};
            //Create Menu Window -- 1
            pNewControl = AWCreateWinControl("TWindow","WinLogo_720P",WS_OVERLAPPEDWINDOW,
		                      0,0,1280,720,NULL, (INT32S)&Normalwindow_para,WinLogoMsgProc_720P) ;
            pNewControl->win_id = 0 ;
            break ;
    }//end of switch
    return pNewControl;
}


void SetFileListViewPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop ;
    if(strcmp(pControl->pClass->class_name, "TFilelist"))
        return ;
    TFILELIST *pList = (TFILELIST *)pControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + (210);
            pControl->winrect.left = pControl->parent->winrect.left + (172);
            pControl->winrect.width = (458);
            pControl->winrect.height = (378);
            pControl->draw_info_num = 0;
            RECT Draw720DrawRect[0] = {
            };
            for(iLoop=0; iLoop < 0; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            pList->filelist_bmp_start_x = (10);
            pList->filelist_bmp_start_y = (0);
            pList->filelist_title_start_x = (64);
            pList->filelist_title_start_y = (14);
            pList->filelist_hint_info.draw_pos_x = pControl->winrect.left + (0);
            pList->filelist_hint_info.draw_pos_y  = pControl->winrect.top + (0);
            pList->filelist_hint_info.draw_width = (0);
            pList->filelist_hint_info.draw_height = (0);
            pList->list_up_arrow_info.draw_pos_x = pControl->winrect.left + (0);
            pList->list_up_arrow_info.draw_pos_y  = pControl->winrect.top ; 
            pList->list_up_arrow_info.draw_width = pControl->winrect.width + pList->list_up_arrow_info.draw_pos_x - pControl->winrect.left;
            pList->list_up_arrow_info.draw_height = (0);
            pList->list_down_arrow_info.draw_pos_x = pList->list_up_arrow_info.draw_pos_x;
            pList->list_down_arrow_info.draw_pos_y  = pControl->winrect.top + pControl->winrect.height - pList->list_up_arrow_info.draw_height; 
            pList->list_down_arrow_info.draw_width = pList->list_up_arrow_info.draw_width ;
            pList->list_down_arrow_info.draw_height = pList->list_up_arrow_info.draw_height;
            break ;

    }//end of switch
    return;
}

INT32S FileListViewMsgProc_720P(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
                return FileListViewOnShow_nodir(hwnd, lpParam) ;
                
        case WM_KEYDOWN:
                return FileListViewOnKeyPress_nodir(hwnd, lpParam) ;
                
		case WM_PAINT:
				return FileListViewOnPaint(hwnd, lpParam);
				
		default:
                return FileListViewOnOtherEvent(hwnd, msg_type, lpParam);
    }
    return 0 ;
}

HWND *CreateControlFileListView_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- FileListView_720P
    HWND *pNewControl;
    TFILELIST *pList;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TFilelist","FileListView_720P",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      172,210,458,378,pParent, 7, FileListViewMsgProc_720P) ;
            pNewControl->win_id = 6 ;
            pNewControl->draw_info_num = 0;
            pList = (TFILELIST *)pNewControl;
            TFILELIST Draw720FileList = {{}, 0,
                          7,0,0,0,0,
                          (INT32U)ICON_FILELIST_BAR_LOSE,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_LOSE,
#ifndef AML_DIR
                          (INT32U)ICON_FILELIST_BAR_LOSE,
#else
			                    (INT32U)ICON_FILELIST_BAR_FOCUS,
#endif
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_LOSE,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          0,0,0,0,
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                           NULL,
                           GetNextFileListCB,
                           GetPrevFileListCB,
                           CDNewDir,
                           GetFullName,
                           CDRootDir};
            Draw720FileList.filelist_items = pList->filelist_items ;
            Draw720FileList.hwnd = pList->hwnd ;
            *pList =Draw720FileList;
            break ;

    }//end of switch
            return pNewControl;
}


void SetMusic_Spectrum_PanelPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + 186;
            pControl->winrect.left = pControl->parent->winrect.left + 674;
            pControl->winrect.width = 252;
            pControl->winrect.height = 150;
            pControl->draw_info_num = 17;
            RECT Draw720DrawRect[17] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,252,150},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 18,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 36,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 54,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 72,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 90,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 108,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 126,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 144,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 162,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 180,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 198,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 216,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 234,pControl->winrect.top + 0,14,150},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            };
            for(iLoop=0; iLoop < 17; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            break ;
           
    }//end of switch
    return;
}

HWND *CreateControlMusic_Spectrum_Panel_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- Music_Spectrum_Panel_720P
    HWND *pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TControl","Music_Spectrum_Panel_720P",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      674,186,252,150,pParent,0,NULL) ;
            pNewControl->win_id = 13 ;
            pNewControl->draw_info_num = 17;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO Draw720DrawDatas[17] = {
                          {0,0,252,150,(INT32U)ICON_MUSIC_SPECTRUM_BK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA}};            	
                          
            memcpy(pNewControl->draw_info,Draw720DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;

    }//end of switch
            return pNewControl;
}

void SetMusic_ProcessBar_PanelPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + 354;
            pControl->winrect.left = pControl->parent->winrect.left + 660;
            pControl->winrect.width = 516;
            pControl->winrect.height = 62;
            pControl->draw_info_num = 6;
            RECT Draw720DrawRect[6] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,410,62},
            {pControl->winrect.left + 20,pControl->winrect.top + 5,56,48},
            {pControl->winrect.left + 80,pControl->winrect.top + 5,56,48},
            {pControl->winrect.left + 166,pControl->winrect.top + 24,236,10},
            {pControl->winrect.left + 410,pControl->winrect.top + 0,106,62},
            {pControl->winrect.left + 420,pControl->winrect.top + 20,90,32},
            };
            for(iLoop=0; iLoop < 6; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            break ;
            
    }//end of switch
    return;
}

HWND *CreateControlMusic_ProcessBar_Panel_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- Music_ProcessBar_Panel_720P
    HWND *pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TControl","Music_ProcessBar_Panel_720P",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      660,354,516,62,pParent,0,NULL) ;
            pNewControl->win_id = 14 ;
            pNewControl->draw_info_num = 6;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;            
            DRAWINFO Draw720DrawDatas[6] = {
                          {0,0,512,62,(INT32U)ICON_MUSIC_PLAY_BAR_BK,DT_RLE_BMP_DATA},
                          {0,0,56,48,(INT32U)ICON_INFO_BLANK,DT_RLE_BMP_DATA},                          
                          {0,0,56,48,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,236,10,(INT32U)ICON_MUSIC_PROCESSBAR_BLANK,DT_RLE_BMP_DATA},
                          {0,0,100,44,(INT32U)ICON_MUSIC_TIME_BLANK,DT_RLE_BMP_DATA},
                          {0,0,90,32,(INT32U)mediabox_time_str,DT_STRING_DATA},
                          };
            memcpy(pNewControl->draw_info,Draw720DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;            
            break ;
            
    }//end of switch
            return pNewControl;
}

void SetMusic_FileInfo_PanelPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + 426;
            pControl->winrect.left = pControl->parent->winrect.left + 664;
            pControl->winrect.width = 516;
            pControl->winrect.height = 206;
            pControl->draw_info_num = 9;
            RECT Draw720DrawRect[9] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,516,206},
            
            {pControl->winrect.left + 0,pControl->winrect.top + 0,100,28},
            {pControl->winrect.left + 0,pControl->winrect.top + 28,100,28},
            {pControl->winrect.left + 0,pControl->winrect.top + 56,100,28},
            {pControl->winrect.left + 0,pControl->winrect.top + 84,100,28},
            
            {pControl->winrect.left + 100,pControl->winrect.top + 0,200,28},
            {pControl->winrect.left + 100,pControl->winrect.top + 28,200,28},
            {pControl->winrect.left + 100,pControl->winrect.top + 56,200,28},
            {pControl->winrect.left + 100,pControl->winrect.top + 84,200,28},            
            };
            for(iLoop=0; iLoop < 9; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            break ;
            
	}//end of switch
    return;
}

HWND *CreateControlMusic_FileInfo_Panel_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- Music_FileInfo_Panel_720P
    HWND *pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TControl","Music_FileInfo_Panel_720P",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      664,426,516,206,pParent,0,NULL) ;
            pNewControl->win_id = 15 ;
            pNewControl->draw_info_num = 9;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO Draw720DrawDatas[9] = {
                          {0,0,516,206,(INT32U)ICON_INFO_BACKGROUNG,DT_RLE_BMP_DATA},

                          {0,6,100,36,(INT32U)debug_string[0],DT_STRING_DATA},
                          {0,42,100,36,(INT32U)debug_string[1],DT_STRING_DATA},
                          {0,78,100,36,(INT32U)debug_string[2],DT_STRING_DATA},
                          {0,114,100,36,(INT32U)debug_string[3],DT_STRING_DATA},

                          {0,6,200,36,(INT32U)debug_string[4],DT_STRING_DATA},
                          {0,42,200,36,(INT32U)debug_string[5],DT_STRING_DATA},
                          {0,78,200,36,(INT32U)debug_string[6],DT_STRING_DATA},
                          {0,114,200,36,(INT32U)debug_string[7],DT_STRING_DATA},
                          };
            memcpy(pNewControl->draw_info,Draw720DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
            			
    }//end of switch
            return pNewControl;
}

void SetVideo_PreviewScreen_ScreenPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + 146;
            pControl->winrect.left = pControl->parent->winrect.left + 718;
            pControl->winrect.width = 458;
            pControl->winrect.height = 298;
            pControl->draw_info_num = 2;
            RECT Draw720DrawRect[2] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,458,298},
            {pControl->winrect.left + 6,pControl->winrect.top + 6,444,282},
            };
            for(iLoop=0; iLoop < 2; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            break ;
            
    }//end of switch
    return;
}

INT32S Video_PreviewScreen_ScreenMsgProc_720P(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return Video_PreviewScreen_ScreenOnShow(hwnd, lpParam) ;
    }
    return 0 ;
}


HWND *CreateControlVideo_PreviewScreen_Screen_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- Video_PreviewScreen_Screen_720P
    HWND *pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TControl","Video_PreviewScreen_Screen_720P",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      724,152,444,282,pParent,0,Video_PreviewScreen_ScreenMsgProc_720P) ;
            pNewControl->win_id = 16 ;
            pNewControl->draw_info_num = 2;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO Draw720DrawDatas[2] = {
                          {0,0,458,298,(INT32U)ICON_MOVIE_PREV_BACKGROUND,DT_RLE_BMP_DATA},
                          {0,0,444,282,(INT32U)ICON_60,DT_RLE_BMP_DATA},
                          };
            memcpy(pNewControl->draw_info,Draw720DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
            
    }//end of switch
            return pNewControl;
}


void SetVideo_FileInfo_PanelPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + 460;
            pControl->winrect.left = pControl->parent->winrect.left + 700;
            pControl->winrect.width = 490;
            pControl->winrect.height = 162;
            pControl->draw_info_num = 7;
            RECT Draw720DrawRect[7] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,490,162},
            
            {pControl->winrect.left + 6,pControl->winrect.top + 40,100,30},
            {pControl->winrect.left + 6,pControl->winrect.top + 80,100,30},
            {pControl->winrect.left + 6,pControl->winrect.top + 120,100,30},
            
            {pControl->winrect.left + 120,pControl->winrect.top + 40,280,30},
            {pControl->winrect.left + 120,pControl->winrect.top + 80,280,30},
            {pControl->winrect.left + 120,pControl->winrect.top + 120,280,30},            
            };
            for(iLoop=0; iLoop < 7; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            break ;
            
    }//end of switch
    return;
}

HWND *CreateControlVideo_FileInfo_Panel_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- Video_FileInfo_Panel_720P
    HWND *pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TControl","Video_FileInfo_Panel_720P",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      700,460,490,162,pParent,0,NULL) ;
            pNewControl->win_id = 17 ;
            pNewControl->draw_info_num = 7;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO Draw720DrawDatas[7] = {
                          {0,0,490,162,(INT32U)ICON_MOVIE_INFOR,DT_RLE_BMP_DATA},

                          {6,40,100,30,(INT32U)debug_string[0],DT_STRING_DATA},
                          {6,80,100,30,(INT32U)debug_string[1],DT_STRING_DATA},
                          {6,120,100,30,(INT32U)debug_string[2],DT_STRING_DATA},                          
                          
                          {120,40,280,30,(INT32U)debug_string[3],DT_STRING_DATA},
                          {120,80,280,30,(INT32U)debug_string[4],DT_STRING_DATA},
                          {120,120,280,30,(INT32U)debug_string[5],DT_STRING_DATA}
                          };
            memcpy(pNewControl->draw_info,Draw720DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
            
    }//end of switch
            return pNewControl;
}


void SetSound_Volume_PanelPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + 62;
            pControl->winrect.left = pControl->parent->winrect.left + 988;
            pControl->winrect.width = 130;
            pControl->winrect.height = 68;
            pControl->draw_info_num = 2;
            RECT Draw720DrawRect[2] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,88,68},
            {pControl->winrect.left + 88,pControl->winrect.top + 0,42,68},
            };
            for(iLoop=0; iLoop < 2; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            break ;
            
    }//end of switch
    return;
}

HWND *CreateControlSound_Volume_Panel_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- Sound_Volume_Panel_720P
    HWND *pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TControl","Sound_Volume_Panel_720P",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      988,62,130,68,pParent,0,NULL) ;
            pNewControl->win_id = 18 ;
            pNewControl->draw_info_num = 2;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO Draw720DrawDatas[2] = {
                          {0,0,0,0,(INT32U)ICON_SPEAKER,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_VOLUME0,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,Draw720DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
            
    }//end of switch
            return pNewControl;
}

void SetMedia_FileList_BK_PanelPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + 0;
            pControl->winrect.left = pControl->parent->winrect.left + 0;
            pControl->winrect.width = 1280;
            pControl->winrect.height = 720;
            pControl->draw_info_num = 8;
            RECT Draw720DrawRect[8] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,1280,720},
            {pControl->winrect.left + 126,pControl->winrect.top + 212,40,34},
            {pControl->winrect.left + 126,pControl->winrect.top + 562,40,34},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            {pControl->winrect.left + 660,pControl->winrect.top + 164,522,192},
            };
            for(iLoop=0; iLoop < 8; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            break ;

    }//end of switch
    return;
}

HWND *CreateControlMedia_FileList_BK_Panel_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- Media_FileList_BK_Panel_720P
    HWND *pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TControl","Media_FileList_BK_Panel_720P",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      0,0,1280,720,pParent,0,NULL) ;
            pNewControl->win_id = 20 ;
            pNewControl->draw_info_num = 8;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO Draw720DrawDatas[8] = {
						  {0,0,1280,720,(INT32U)ICON_PHOTO_BACKGROUND,DT_RLE_BMP_DATA},
                          {126,212,40,34,(INT32U)0,DT_RLE_BMP_DATA},
						  {126,562,40,34,(INT32U)0,DT_RLE_BMP_DATA},            
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
						  {0,0,522,192,(INT32U)ICON_FILELIST_MUSIC_BACKGROUND,DT_RLE_BMP_DATA},
                          };
            memcpy(pNewControl->draw_info,Draw720DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
            
    }//end of switch
            return pNewControl;
}

INT32S MediaTopMsgProc_720P(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return MediaToplOnShow(hwnd, lpParam) ;
    }
    return 0 ;
}

void SetMediaTopPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + 30;
            pControl->winrect.left = pControl->parent->winrect.left + 0;
            pControl->winrect.width = 212;
            pControl->winrect.height = 116;
            pControl->draw_info_num = 1;
            RECT Draw720DrawRect[1] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 30,212,116},
            };
            for(iLoop=0; iLoop < 1; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            break ;
            
    }//end of switch
    return;
}

HWND *CreateControlMediaTop_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- MediaTop_720P
    HWND *pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TControl","MediaTop_720P",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      0,30,212,116,pParent,0,MediaTopMsgProc_720P) ;
            pNewControl->win_id = 5 ;
            pNewControl->draw_info_num = 1;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO Draw720DrawDatas[1] = {
                          {0,30,212,116,(INT32U)ICON_MUSIC_TOP,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,Draw720DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
            
    }//end of switch
            return pNewControl;
}

INT32S MoveStringMsgProc_720P(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return MoveStringOnShow(hwnd, lpParam) ;
            
		case WM_PAINT:
			return MoveStringOnPaint(hwnd, lpParam);

		default:
			break;
    }
    return 0 ;
}

void SetMoveStringPos_720P(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
		case OsdSize720p:
            pControl->winrect.top = pControl->parent->winrect.top + 0;
            pControl->winrect.left = pControl->parent->winrect.left + 0;
            pControl->winrect.width = 392;
            pControl->winrect.height = 54;
            pControl->draw_info_num = 2;
            RECT Draw720DrawRect[2] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,392,54},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,330,54},
            };
            for(iLoop=0; iLoop < 2; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw720DrawRect[iLoop], sizeof(RECT));
            break ;
            
    }//end of switch
    return;
}

HWND *CreateControlMoveString_720P(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- MoveString_720P
    HWND *pNewControl;
    switch(CurOsdSize){
		case OsdSize720p:
            pNewControl = AWCreateWinControl("TControl","MoveString_720P",(WS_CHILDWINDOW | WS_CHILDWINDOW),
							  0,0,392,54,pParent,0,MoveStringMsgProc_720P) ;
            pNewControl->win_id = 7 ;
            pNewControl->draw_info_num = 2;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO Draw720DrawDatas[2] = {
            			  {0,0,392,54,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,330,54,(INT32U)0,DT_VOSD_DATA}};
            memcpy(pNewControl->draw_info,Draw720DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
            
    }//end of switch
            return pNewControl;
}



HWND* CreateMenuWinLogo_720P(void)
{
    HWND *pNewControl ;
    TWINDOWS *pWin;
    HWND *pWinLogo_720P = CreateControlWinLogo_720P(NULL,CurrentOsdSize);
    SetWinLogoPos_720P(pWinLogo_720P,CurrentOsdSize);

    pNewControl= CreateControlMediaTop_720P(pWinLogo_720P,CurrentOsdSize);
    SetMediaTopPos_720P(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlFileListView_720P(pWinLogo_720P,CurrentOsdSize);
    SetFileListViewPos_720P(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlMoveString_720P(pWinLogo_720P,CurrentOsdSize);
    SetMoveStringPos_720P(pNewControl,CurrentOsdSize);    

    pNewControl= CreateControlMusic_Spectrum_Panel_720P(pWinLogo_720P,CurrentOsdSize);
    SetMusic_Spectrum_PanelPos_720P(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlMusic_ProcessBar_Panel_720P(pWinLogo_720P,CurrentOsdSize);
    SetMusic_ProcessBar_PanelPos_720P(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlMusic_FileInfo_Panel_720P(pWinLogo_720P,CurrentOsdSize);
    SetMusic_FileInfo_PanelPos_720P(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlVideo_PreviewScreen_Screen_720P(pWinLogo_720P,CurrentOsdSize);
    SetVideo_PreviewScreen_ScreenPos_720P(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlVideo_FileInfo_Panel_720P(pWinLogo_720P,CurrentOsdSize);
    SetVideo_FileInfo_PanelPos_720P(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlSound_Volume_Panel_720P(pWinLogo_720P,CurrentOsdSize);
    SetSound_Volume_PanelPos_720P(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlMedia_FileList_BK_Panel_720P(pWinLogo_720P,CurrentOsdSize);
    SetMedia_FileList_BK_PanelPos_720P(pNewControl,CurrentOsdSize);
    
    pWin = (TWINDOWS *)pWinLogo_720P;
    pWin->pFocusControl = AWFindWinCtrlByName("FileListView_720P");
    return pWinLogo_720P;
}

void WinResetWinLogoControlsPos_720P(HWND *pControl, INT8U CurOsdSize)
{
    switch(pControl->win_id){
        case 0://WinLogo_720P
            SetWinLogoPos_720P(pControl,CurOsdSize) ;
            break ;
        case 5://MediaTop_720P
            SetMediaTopPos_720P(pControl,CurOsdSize) ;            
            break ;
        case 6://FileListView_720P
            SetFileListViewPos_720P(pControl,CurOsdSize) ;
            break ;
        case 7://MoveString_720P
            SetMoveStringPos_720P(pControl,CurOsdSize) ;            
            break ;            
        case 13://Music_Spectrum_Panel_720P
            SetMusic_Spectrum_PanelPos_720P(pControl,CurOsdSize) ;
            break ;
        case 14://Music_ProcessBar_Panel_720P
            SetMusic_ProcessBar_PanelPos_720P(pControl,CurOsdSize) ;
            break ;
        case 15://Music_FileInfo_Panel_720P
            SetMusic_FileInfo_PanelPos_720P(pControl,CurOsdSize) ;
            break ;
        case 16://Video_PreviewScreen_Screen_720P
            SetVideo_PreviewScreen_ScreenPos_720P(pControl,CurOsdSize) ;
            break ;
        case 17://Video_FileInfo_Panel_720P
            SetVideo_FileInfo_PanelPos_720P(pControl,CurOsdSize) ;
            break ;
        case 18://Sound_Volume_Panel_720P
            SetSound_Volume_PanelPos_720P(pControl,CurOsdSize) ;
            break ;
        case 20://Media_FileList_BK_Panel_720P
            SetMedia_FileList_BK_PanelPos_720P(pControl,CurOsdSize) ;
            break ;
    }//end of switch
}
void WinResetWinLogoPos_720P(HWND *pControl, INT8U CurOsdSize)
{
    HWND *pChildControl;
    if(pControl == NULL)
        pControl = AWFindWinCtrlByName("WinLogo_720P");
    if(pControl == NULL) return ;

    WinResetWinLogoControlsPos_720P(pControl, CurOsdSize) ;
    pChildControl = pControl->children ;
    while(pChildControl != NULL){
    	WinResetWinLogoPos_720P(pChildControl, CurOsdSize) ;
    	pChildControl = pChildControl->siblings ;
	}
	return ;
}

